// 对外暴露配置路由（常亮路由）
export const constantRoute = [
  {
    // 登录路由
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录',
      hidden: true, // 隐藏路由 (默认false 不隐藏)
      icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
    },
  },
  {
    // 登录成功后展示数据的路由
    path: '/',
    name: 'layout',
    component: () => import('@/layout/index.vue'),
    redirect: '/home',
    meta: {
      title: '',
      hidden: false,
      icon: '',
    },
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },

  {
    // 404 页面
    path: '/404',
    name: '404',
    component: () => import('@/views/404/index.vue'),
    meta: {
      title: '404',
      hidden: true,
    },
  },
]
// 异步路由
export const asyncRoute = [
  {
    path: '/front',
    component: () => import('@/layout/index.vue'),
    name: '前台管理',
    meta: {
      title: '前台管理',
      icon: 'Dish',
    },
    children: [
      {
        path: '/food',
        component: () => import('@/views/front/food/index.vue'),
        name: '美食管理',
        meta: {
          title: '美食管理',
          icon: 'Dish',
        },
      },
      {
        path: '/travel',
        component: () => import('@/views/front/travel/index.vue'),
        name: '旅游管理',
        meta: {
          title: '旅游管理',
          icon: 'Guide',
        },
      },
      {
        path: '/comment',
        component: () => import('@/views/front/comment/index.vue'),
        name: '评论管理',
        meta: {
          title: '评论管理',
          icon: 'Comment',
        },
      },
      {
        path: '/feedback',
        component: () => import('@/views/front/feedback/index.vue'),
        name: '用户反馈',
        meta: {
          title: '用户反馈',
          icon: 'ChatSquare',
        },
      },
    ],
  },

  {
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    name: '权限管理',
    meta: {
      title: '权限管理',
      icon: 'Lock',
    },
    children: [
      {
        path: '/adminUser',
        component: () => import('@/views/acl/user/index.vue'),
        name: '用户管理',
        meta: {
          title: '用户管理',
          icon: 'User',
        },
      },
      {
        path: '/role',
        component: () => import('@/views/acl/role/index.vue'),
        name: '职位管理',
        meta: {
          title: '职位管理',
          icon: 'Crop',
        },
      },
      {
        path: '/menu',
        component: () => import('@/views/acl/menus/index.vue'),
        name: '菜单管理',
        meta: {
          title: '菜单管理',
          icon: 'Grid',
        },
      },
    ],
  },
  {
    path: '/media',
    component: () => import('@/layout/index.vue'),
    name: '媒体管理',
    meta: {
      title: '媒体管理',
      icon: 'Picture',
    },
    redirict: '/media/images',
    children: [
      {
        path: '/media/images',
        name: '图片审核',
        component: () => import('@/views/media/images/index.vue'),
        meta: {
          title: '图片审核',
          icon: 'Picture',
        },
      },
      {
        path: '/media/videos',
        name: '视频审核',
        component: () => import('@/views/media/videos/index.vue'),
        meta: {
          title: '视频审核',
          icon: 'VideoPlay',
        },
      },
    ],
  },
]
// 任意路由
export const anyRoute = {
  // 重定向404
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  name: 'any',
  meta: {
    title: '',
    hidden: true,
  },
}
